package com.otitan.la.forest.industry.vo;

import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description: 当前类作用描述
 * @Author: xiazw
 * @CreateDate: 2020/10/20 20:26
 */
@Data
public class FirstProductAccountedVO {
    private BigDecimal fisBreandnurAllTotal;
    private String fisBreandnurAllTotalAccount;
    private BigDecimal fisAfforeTotal;
    private String fisAfforeTotalAccount;
    private BigDecimal fisWoodandbamAllTotal;
    private String fisWoodandbamAllTotalAccount;
    private BigDecimal fisEcoforeproAllTotal;
    private String fisEcoforeproAllTotalAccount;
    private BigDecimal fisFlowerTotal;
    private String fisFlowerTotalAccount;
    private BigDecimal fisAnimaluseTotal;
    private String fisAnimaluseTotalAccount;
    private BigDecimal fisTatalTatalvalue;
    private String fisTatalTatalvalueAccount;

    public FirstProductAccountedVO() {
    }

    public FirstProductAccountedVO(BigDecimal fisBreandnurAllTotal, BigDecimal fisAfforeTotal, BigDecimal fisWoodandbamAllTotal, BigDecimal fisEcoforeproAllTotal,
                                   BigDecimal fisFlowerTotal, BigDecimal fisAnimaluseTotal,
                                   BigDecimal fisTatalTatalvalue) {
        this.fisBreandnurAllTotal = fisBreandnurAllTotal;
        this.fisAfforeTotal = fisAfforeTotal;
        this.fisWoodandbamAllTotal = fisWoodandbamAllTotal;
        this.fisEcoforeproAllTotal = fisEcoforeproAllTotal;
        this.fisFlowerTotal = fisFlowerTotal;
        this.fisAnimaluseTotal = fisAnimaluseTotal;
        this.fisTatalTatalvalue = fisTatalTatalvalue;
        BigDecimal allcount = fisTatalTatalvalue.add(fisBreandnurAllTotal).add(fisAfforeTotal).add(fisWoodandbamAllTotal)
                .add(fisEcoforeproAllTotal).add(fisFlowerTotal).add(fisAnimaluseTotal).add(fisTatalTatalvalue);
        // this.fisTatalTatalAccount=fisTatalTatalvalue.divide(allcount,4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"))+"%";
        this.fisBreandnurAllTotalAccount = fisBreandnurAllTotal.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
        this.fisAfforeTotalAccount = fisAfforeTotal.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
        this.fisWoodandbamAllTotalAccount = fisWoodandbamAllTotal.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
        this.fisEcoforeproAllTotalAccount = fisEcoforeproAllTotal.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
        this.fisFlowerTotalAccount = fisFlowerTotal.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
        this.fisAnimaluseTotalAccount = fisAnimaluseTotal.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
        this.fisTatalTatalvalueAccount = fisTatalTatalvalue.divide(allcount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100")) + "%";
    }

    public FirstProductAccountedVO getFirstProductAccounted(FirstProductAccountedVO first) {
        return new FirstProductAccountedVO(first.getFisBreandnurAllTotal(), first.getFisAfforeTotal(), first.getFisWoodandbamAllTotal(), first.getFisEcoforeproAllTotal(),
                first.getFisFlowerTotal(), first.getFisAnimaluseTotal(),
                first.getFisTatalTatalvalue());
    }
}
